#include "readonlydelegate.h"

ReadOnlyDelegate::ReadOnlyDelegate(QObject *parent)
    : QStyledItemDelegate(parent)
{

}

bool ReadOnlyDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
{
    if (index.column() == 0) {
        return false;  // 禁止编辑第一列
    }
    return QStyledItemDelegate::editorEvent(event, model, option, index);  // 默认处理
}
